import { stringify } from 'qs';
import request from '../utils/request';

/**
 * OpenStack
 */
export async function queryVRegionSubnets(params) {
  // return request(`/api/openstacks?${stringify(params)}`);
  return request(`/api/test/vregionsubnets?${stringify(params)}`);
}
export async function removeVRegionSubnet(params) {
  return request(`/api/test/vregionsubnets/${params}`, {
    method: 'DELETE',
  });
}

export async function createVRegionSubnet(params) {
  return request('/api/test/vregionsubnets', {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function updateVRegionSubnet(params) {
  const { id, ...data } = params;
  return request(`/api/test/vregionsubnets/${id}`, {
    method: 'PATCH',
    body: {
      ...data,
    },
  });
}
export async function getVRegionSubnet(id) {
  return request(`/api/test/vregionsubnets/${id}`);
}
